﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RemoteController
{
    public class PartyMacroCommandGetter : MacroGetter
    {
        private LivingroomLightOnCommand lightOn;
        private LivingroomLightOffCommand lightOff;
        private StereoOnCommand stereoOn;
        private StereoOffCommand stereoOff;
        private CeilingFanOnCommand fanOn;
        private CeilingFanOffCommand fanOff;

        public Command[] commandsON;
        public Command[] commandsOFF;

        private MacroCommand partyOnMacro;
        private MacroCommand partyOffMacro;


        public PartyMacroCommandGetter(Light light, Stereo stereo, CeilingFan fan)
        {            
            lightOn = new LivingroomLightOnCommand(light);
            lightOff = new LivingroomLightOffCommand(light);

            stereoOn = new StereoOnCommand(stereo);
            stereoOff = new StereoOffCommand(stereo);
            
            fanOn = new CeilingFanOnCommand(fan);
            fanOff = new CeilingFanOffCommand(fan);

            commandsON  = new Command[] { lightOn, stereoOn, fanOn };
            //commandsOFF = new Command[] { fanOff, stereoOff, lightOff };    
            commandsOFF = new Command[] { lightOff, stereoOff, fanOff };
            

            partyOnMacro = new MacroCommand(commandsON);
            partyOffMacro = new MacroCommand(commandsOFF);
        }

        public virtual MacroCommand getOnMacro()
        {
            
            return partyOnMacro;
        }

        public virtual MacroCommand getOffMacro()
        {
            
            return partyOffMacro;
        }
    }
}
